/**
 * 使用方法
 * <footer current="2"></footer>
 * */
const app = getApp();
Component({
    properties: {
        /**
         * 是否显示
         * */
        showNav: {type: Boolean},
        animationDatas: {
            type: Object,
            value: false
        },
        list: {type: Array}
    },
    data: {

    },
    methods: {
        closed: function () {
            var that = this;
            var animation = wx.createAnimation({
                duration: 400,
                timingFunction: 'linear'
            })
            that.animation = animation
            animation.translateY(-690).step()
            that.setData({
                animationDatas: animation.export(),
            })
            setTimeout(function () {
                animation.translateY(0).step()
                that.setData({
                    animationDatas: animation.export(),
                    showNav: false
                })
            }, 300)
        },
        toPage: function (even) {
            let $dataset = even.currentTarget.dataset;
            app.redirectTo(app.page.home, 'id='+$dataset.item.id);
        },
    },
});
